import React, { useState } from "react"
import { Modal } from "antd"
import UniversalUpload from "@/components/upload/UniversalUpload"

function UploadFile({ modalProps, ...restProps }) {
  const [file, setFile] = useState([])
  return (
    <Modal
      {...modalProps}
      forceRender
      onOk={() => {
        restProps.imageSuccessCBK(file)
      }}
    >
      <UniversalUpload
        isDragger={true}
        getFileInfo={(r) => {
          setFile(() => [...r])
        }}
      />
    </Modal>
  )
}

export default UploadFile
